package com.apes.scm.masterdata.stock.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.scm.masterdata.multiKeys.UsageOrderType;
import com.apes.scm.masterdata.stock.model.UsageBusiness;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface UsageBusinessRepository extends CustomRepository<UsageBusiness, UsageOrderType> {

    @Query(value = "SELECT T.* FROM mas_usage_business T WHERE 1 = 1 and T.business_type_id = :businessType and T.valid =:valid ",nativeQuery=true)
    List<UsageBusiness> findByBusinessTypeAndValid(@Param("businessType") String businessType , @Param("valid") Boolean valid);
}
